package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.OrgHonorDao;
import com.chinasi.model.OrgHonor;
import com.chinasi.service.OrgHonorService;

@Service
public class OrgHonorServiceImpl implements OrgHonorService {

	/**
	 * OrgHonorDAO
	 */
	@Autowired
	private OrgHonorDao orgHonorDao;

	@Override
	public Pager findPageByOrgId(String orgId, int currentPage) {
		OrgHonor searchBean = new OrgHonor();
		searchBean.setOrgId(orgId);
		Pager pager = new Pager(orgHonorDao.getTotalCount(searchBean));
		pager.setCurrentPage(currentPage);
		pager.setData(orgHonorDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}
	
}
